<template>
	<view>
		<u-navbar :autoBack="true" leftIconSize="40rpx" leftIconColor="#fff" title="收款码" :placeholder="true" bgColor="#f9bb34" :titleStyle="{ fontSize: '30rpx',color:'#fff' , fontWeight: 'bold'}"></u-navbar>
		<view class="receiptQRCodeBox">
			<view class="qrcodeBox">
				<view class="merchantInfo">
					<image src="../../static/icons/ShopOutlined.png"></image>
					<text>瑞安市加叻服饰经营部</text>
				</view>
				<view class="qrcode">
					<view 
						class="left" 
						:style="{opacity: qrcodeIndex == 0 ? 0.2 : 1}"
						@click="switchover('up')"
					>
						<image src="../../static/icons/bottom-3.png"></image>
					</view>
					<view class="content">
						<image :src="qrcodeImgArray[qrcodeIndex]"></image>
					</view>
					<view 
						class="right" 
						:style="{opacity: qrcodeIndex == (qrcodeImgArray.length-1) ? 0.2 : 1}"
						@click="switchover('down')"
					>
						<image src="../../static/icons/bottom-3.png"></image>
					</view>
				</view>
				<view class="integrateBox">
					<image src="../../static/icons/PieChartOutlined.png"></image>
					<text>积分比例</text>
					<text>{{integralProportion[qrcodeIndex]}}%</text>
				</view>
			</view>
			<view class="buttonBox flex-center" @click="gocollectionCodeManagement">
				<image src="../../static/icons/PAYEECODE.png"></image>
				<text>收款码管理</text>
			</view>
			<view class="buttonBox flex-center">
				<image src="../../static/icons/downland.png"></image>
				<text>保存图片</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				qrcodeIndex:0,
				qrcodeImgArray:[
					"../../static/image/ewm.png",
					"../../static/image/ewm.png"
				],
				integralProportion:[
					20,3
				]
			}
		},
		methods:{
			switchover(type){
				if(type == 'up' && this.qrcodeIndex > 0){
					this.qrcodeIndex--
				}
				if(type == 'down' && this.qrcodeIndex < (this.qrcodeImgArray.length-1)){
					this.qrcodeIndex++;
				}
			},
			gocollectionCodeManagement(){
				this.$Router.push({
					path: '/pages/merchant/collectionCodeManagement'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.receiptQRCodeBox{
		float: left;
		width: 100%;
		height: 100%;
		position: absolute;
		background-color: #f9bb34;
		.qrcodeBox{
			width: 90%;
			height: auto;
			float: left;
			margin-top: 20rpx;
			margin-left: 5%;
			background-color: #fff;
			border-radius: 15rpx;
			.merchantInfo{
				width: 96%;
				height: 80rpx;
				float: left;
				margin-left: 2%;
				border-bottom: 1rpx solid rgba(110,110,110,0.2);
				image{
					width: 40rpx;
					height: 40rpx;
					float: left;
					margin-top: 20rpx;
					margin-left: 10rpx;
				}
				text{
					width: auto;
					height: 80rpx;
					float: left;
					margin-left: 15rpx;
					font-size: 30rpx;
					line-height: 80rpx;
					color: #363636;
					font-weight: 400;
				}
			}
			.qrcode{
				width: 100%;
				height: 580rpx;
				float: left;
				.left{
					width: 90rpx;
					float: left;
					height: 100%;
					display: flex;
					justify-content: center;
					align-items: center;
					image{
						width: 60rpx;
						height: 60rpx;
						transform: rotate(90deg);
					}
				}
				.right{
					width: 90rpx;
					float: right;
					height: 100%;
					display: flex;
					justify-content: center;
					align-items: center;
					image{
						width: 60rpx;
						height: 60rpx;
						transform: rotate(-90deg);
					}
				}
				.content{
					width: calc(100% - 180rpx);
					height: 100%;
					display: flex;
					justify-content: center;
					align-items: center;
					float: left;
					image{
						width: 370rpx;
						height: 370rpx;
					}
				}
			}
			.integrateBox{
				width: 96%;
				height: 80rpx;
				float: left;
				margin-left: 2%;
				border-top:1rpx solid rgba(110,110,110,0.2);
				image{
					width: 44rpx;
					height: 44rpx;
					float: left;
					margin-top: 18rpx;
					margin-left: 10rpx;
				}
				text{
					font-size: 34rpx;
					height: 80rpx;
					font-weight: 400;
					line-height: 80rpx;
					color:#363636;
				}
				text:nth-child(2){
					float: left;
					margin-left: 10rpx;
				}
				text:nth-child(3){
					float: right;
				}
			}
		}
		.buttonBox{
			width: 90%;
			height: 90rpx;
			float: left;
			margin-left: 5%;
			margin-top:20rpx;
			background-color: #fff;
			border-radius: 15rpx;
			display: flex;
			image{
				width: 33rpx;
				height: 33rpx;
			}
			text{
				font-size: 30rpx;
				margin-left: 6rpx;
				font-weight: bold;
				color: #363636;
			}
		}
		
	}
</style>